package com.itheima.a01plymorphismdemo1;

public class Test {
    public static void main(String[] args) {
        //创建狗的对象
//        Dog d=new Dog(2,"红");
//
//        Person p=new Person("老王",19);
//        p.keepPet(d,"汤汁拌大米饭");
//
//        Cat c=new Cat();
//        c.setAge(3);
//        c.setColor("绿");
//
//        p.keepPet(c,"鱼干");



        Animal a=new Dog(2,"灰");

        Person p=new Person("老王",19);
        p.keepPet(a,"骨头");

        Animal a1=new Cat(3,"绿");

        Person p1=new Person("老李",20);
        p1.keepPet(a1,"小鱼干");
    }
}
